//
//  UIBarButtonItem-Extension.swift
//  WeiBo
//
//  Created by LTX on 2016/11/3.
//  Copyright © 2016年 LTX. All rights reserved.
//

import UIKit

extension UIBarButtonItem{

    convenience init(imageName: String) {
        
        /*
        self.init()
        
        let btn = UIButton()
        btn.setImage(UIImage(named: imageName), for: .normal)
        btn.setImage(UIImage(named: imageName + "_highlighted"), for: .highlighted)
        btn.sizeToFit()
        self.customView = btn
        */
        
        let btn = UIButton()
        btn.setImage(UIImage(named: imageName), for: .normal)
        btn.setImage(UIImage(named: imageName + "_highlighted"), for: .highlighted)
        btn.sizeToFit()
    
        self.init(customView: btn)
        
    }

}
